﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.KlijentNapomena"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class KlijentNapomenaEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// ComboBox for the IDKlijent property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDKlijent;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDKlijent property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDKlijentLabel;
		
		/// <summary>
		/// DataTimePicker for the DateCreated property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxDateCreated;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DateCreated property.
		/// </summary>
		protected System.Windows.Forms.Label uxDateCreatedLabel;
		
		/// <summary>
		/// DataTimePicker for the DateModified property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxDateModified;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DateModified property.
		/// </summary>
		protected System.Windows.Forms.Label uxDateModifiedLabel;
		
		/// <summary>
		/// TextBox for the Napomena property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNapomena;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Napomena property.
		/// </summary>
		protected System.Windows.Forms.Label uxNapomenaLabel;
		
		/// <summary>
		/// ComboBox for the IDUserCreated property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDUserCreated;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDUserCreated property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDUserCreatedLabel;
		
		/// <summary>
		/// ComboBox for the IDUserModified property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDUserModified;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDUserModified property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDUserModifiedLabel;
		#endregion
		
		#region Main entity
		private Entities.KlijentNapomena _KlijentNapomena;
		/// <summary>
		/// Gets or sets the <see cref="Entities.KlijentNapomena"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.KlijentNapomena"/> instance.</value>
		public Entities.KlijentNapomena KlijentNapomena
		{
			get {return this._KlijentNapomena;}
			set
			{
				this._KlijentNapomena = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDKlijent.DataBindings.Clear();
			this.uxIDKlijent.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDKlijent", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDateCreated.DataBindings.Clear();
			this.uxDateCreated.DataBindings.Add("Value", this.uxBindingSource, "DateCreated", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDateModified.DataBindings.Clear();
			this.uxDateModified.DataBindings.Add("Value", this.uxBindingSource, "DateModified", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNapomena.DataBindings.Clear();
			this.uxNapomena.DataBindings.Add("Text", this.uxBindingSource, "Napomena", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDUserCreated.DataBindings.Clear();
			this.uxIDUserCreated.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDUserCreated", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDUserModified.DataBindings.Clear();
			this.uxIDUserModified.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDUserModified", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="KlijentNapomenaEditControlBase"/> class.
		/// </summary>
		public KlijentNapomenaEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_KlijentNapomena != null) _KlijentNapomena.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxIDKlijent = new System.Windows.Forms.ComboBox();
			uxIDKlijentLabel = new System.Windows.Forms.Label();
			this.uxDateCreated = new System.Windows.Forms.DateTimePicker();
			uxDateCreatedLabel = new System.Windows.Forms.Label();
			this.uxDateModified = new System.Windows.Forms.DateTimePicker();
			uxDateModifiedLabel = new System.Windows.Forms.Label();
			this.uxNapomena = new System.Windows.Forms.TextBox();
			uxNapomenaLabel = new System.Windows.Forms.Label();
			this.uxIDUserCreated = new System.Windows.Forms.ComboBox();
			uxIDUserCreatedLabel = new System.Windows.Forms.Label();
			this.uxIDUserModified = new System.Windows.Forms.ComboBox();
			uxIDUserModifiedLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxIDKlijentLabel
			//
			this.uxIDKlijentLabel.Text = "IDKlijent:";
			this.uxIDKlijentLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDKlijentLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKlijentLabel);			
			//
			// uxIDKlijent
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKlijent);
			this.uxIDKlijent.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDKlijent);
			//
			// uxDateCreatedLabel
			//
			this.uxDateCreatedLabel.Text = "DateCreated:";
			this.uxDateCreatedLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxDateCreatedLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDateCreatedLabel);			
			//
			// uxDateCreated
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDateCreated);
			this.uxDateCreated.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxDateCreated);
			//
			// uxDateModifiedLabel
			//
			this.uxDateModifiedLabel.Text = "DateModified:";
			this.uxDateModifiedLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxDateModifiedLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDateModifiedLabel);			
			//
			// uxDateModified
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDateModified);
			this.uxDateModified.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxDateModified);
			//
			// uxNapomenaLabel
			//
			this.uxNapomenaLabel.Text = "Napomena:";
			this.uxNapomenaLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxNapomenaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNapomenaLabel);			
			//
			// uxNapomena
			//
			this.uxNapomena.Width = 250;
			this.uxNapomena.MaxLength = 4000;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNapomena);
			this.uxNapomena.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxNapomena);
			//
			// uxIDUserCreatedLabel
			//
			this.uxIDUserCreatedLabel.Text = "IDUserCreated:";
			this.uxIDUserCreatedLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxIDUserCreatedLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDUserCreatedLabel);			
			//
			// uxIDUserCreated
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDUserCreated);
			this.uxIDUserCreated.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxIDUserCreated);
			//
			// uxIDUserModifiedLabel
			//
			this.uxIDUserModifiedLabel.Text = "IDUserModified:";
			this.uxIDUserModifiedLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxIDUserModifiedLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDUserModifiedLabel);			
			//
			// uxIDUserModified
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDUserModified);
			this.uxIDUserModified.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxIDUserModified);
			//
			// uxIDUserCreated
			//				
			this.uxIDUserCreated.DisplayMember = "Naziv";	
			this.uxIDUserCreated.ValueMember = "ID";	
			//
			// uxIDUserModified
			//				
			this.uxIDUserModified.DisplayMember = "Naziv";	
			this.uxIDUserModified.ValueMember = "ID";	
			//
			// uxIDKlijent
			//				
			this.uxIDKlijent.DisplayMember = "ImeKlijenta";	
			this.uxIDKlijent.ValueMember = "ID";	
			// 
			// KlijentNapomenaEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "KlijentNapomenaEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.Djelatnik> _IDUserCreatedList;
		
		/// <summary>
		/// The ComboBox associated with the IDUserCreated property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Djelatnik> IDUserCreatedList
		{
			get {return _IDUserCreatedList;}
			set 
			{
				this._IDUserCreatedList = value;
				this.uxIDUserCreated.DataSource = null;
				this.uxIDUserCreated.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDUserCreatedList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDUserCreated property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDUserCreatedList
		{
			get { return _allowNewItemInIDUserCreatedList;}
			set
			{
				this._allowNewItemInIDUserCreatedList = value;
				this.uxIDUserCreated.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Djelatnik> _IDUserModifiedList;
		
		/// <summary>
		/// The ComboBox associated with the IDUserModified property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Djelatnik> IDUserModifiedList
		{
			get {return _IDUserModifiedList;}
			set 
			{
				this._IDUserModifiedList = value;
				this.uxIDUserModified.DataSource = null;
				this.uxIDUserModified.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDUserModifiedList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDUserModified property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDUserModifiedList
		{
			get { return _allowNewItemInIDUserModifiedList;}
			set
			{
				this._allowNewItemInIDUserModifiedList = value;
				this.uxIDUserModified.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Klijent> _IDKlijentList;
		
		/// <summary>
		/// The ComboBox associated with the IDKlijent property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Klijent> IDKlijentList
		{
			get {return _IDKlijentList;}
			set 
			{
				this._IDKlijentList = value;
				this.uxIDKlijent.DataSource = null;
				this.uxIDKlijent.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDKlijentList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDKlijent property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKlijentList
		{
			get { return _allowNewItemInIDKlijentList;}
			set
			{
				this._allowNewItemInIDKlijentList = value;
				this.uxIDKlijent.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
